Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to save a conf file to a USB
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Zelt
n00b
n00b


Joined: 07 Jul 2014
Posts: 72

PostPosted: Thu Aug 21, 2014 4:48 pm    Post subject: How to save a conf file to a USB Reply with quote

As simple as this maybe, it is not turning out simple for me to do, Rather getting irritated with it.

I insert a USB, run the following

fdisk -l - (to learn usb drive name = /dev/sdd)
mkdir /usb
mount /dev/sdd /usb
cp /boot/grub/grub.conf /usb
mv /usb/grub.conf /dev/sdd
umount /dev/sdd
umount /usb

Upon detaching the USB drive and checking contents on another PC, the grub.conf file is nowhere to be seen.
_________________
k.
Back to top
View user's profile Send private message
The Doctor
Moderator
Moderator


Joined: 27 Jul 2010
Posts: 2678

PostPosted: Thu Aug 21, 2014 4:57 pm    Post subject: Reply with quote

You need a partition. If the usb was properly formated it should have a single partition which would have been recognized as /dev/sdd1

To find the drive it would have been easer to simply ls /dev/sd* and look for the new device.
_________________
First things first, but not necessarily in that order.

Apologies if I take a while to respond. I'm currently working on the dematerialization circuit for my blue box.
Back to top
View user's profile Send private message
Zelt
n00b
n00b


Joined: 07 Jul 2014
Posts: 72

PostPosted: Thu Aug 21, 2014 4:59 pm    Post subject: Reply with quote

The Doctor wrote:
You need a partition. If the usb was properly formated it should have a single partition which would have been recognized as /dev/sdd1

To find the drive it would have been easer to simply ls /dev/sd* and look for the new device.


I thought I found the drive? Labelled as /dev/sdd?
_________________
k.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3267
Location: Canada

PostPosted: Thu Aug 21, 2014 5:07 pm    Post subject: Reply with quote

Irrespectively to your problem, this sequence

Code:

cp /boot/grub/grub.conf /usb
mv /usb/grub.conf /dev/sdd


really confuses me - what are you trying to do ?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Thu Aug 21, 2014 5:21 pm    Post subject: Reply with quote

Some usb flash drives come with weird factory stuff installed, if useful for its intended purpose do not format such a flash drive.

fdisk -l - (to learn usb drive name = /dev/sdd) --> Did this output include a partition? At least /dev/sdd1 should appear, if not the usb drive needs formatting and a filesystem.
mkdir /usb --> this is ok, custom would be to use /mnt/usb as the mount point
mount /dev/sdd /usb --> mount /dev/sdd1 /usb would work if sdd1 existed and had a filesystem
cp /boot/grub/grub.conf /usb --> Should work to copy /boot/grub/grub.conf to directory /usb on the hard drive's / filesystem
mv /usb/grub.conf /dev/sdd --> no good
umount /dev/sdd --> not mounted
umount /usb --> nothing mounted

if needed, format a usb flash drive, create a partition, and install a filesystem (Usually fat32 is the choice for universal usability.)
mount a partition on the usb, nominally /dev/sdd1 : mount /dev/sdd1 /usb
copy the file : cp /boot/grub/grub.conf /usb
_________________
Defund the FCC.
Back to top
View user's profile Send private message
Zelt
n00b
n00b


Joined: 07 Jul 2014
Posts: 72

PostPosted: Thu Aug 21, 2014 6:28 pm    Post subject: Reply with quote

DONAHUE wrote:
Some usb flash drives come with weird factory stuff installed, if useful for its intended purpose do not format such a flash drive.

fdisk -l - (to learn usb drive name = /dev/sdd) --> Did this output include a partition? At least /dev/sdd1 should appear, if not the usb drive needs formatting and a filesystem.
mkdir /usb --> this is ok, custom would be to use /mnt/usb as the mount point
mount /dev/sdd /usb --> mount /dev/sdd1 /usb would work if sdd1 existed and had a filesystem
cp /boot/grub/grub.conf /usb --> Should work to copy /boot/grub/grub.conf to directory /usb on the hard drive's / filesystem
mv /usb/grub.conf /dev/sdd --> no good
umount /dev/sdd --> not mounted
umount /usb --> nothing mounted

if needed, format a usb flash drive, create a partition, and install a filesystem (Usually fat32 is the choice for universal usability.)
mount a partition on the usb, nominally /dev/sdd1 : mount /dev/sdd1 /usb
copy the file : cp /boot/grub/grub.conf /usb


On a fresh formatted drive from windows.
I enter the USB, find the whole drive node(/dev/sdd)

I run

mkfs -t vfat /dev/sdd

Which returns

Attempting to create a too large filesystem

Usb is 512MB
_________________
k.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54244
Location: 56N 3W

PostPosted: Thu Aug 21, 2014 7:29 pm    Post subject: Reply with quote

Zelt,

USB drives can be formatted like floppies - no partitions, or like hard drives, with a partition table.
As pen drives get bigger, the latter is becoming more common.

Your mounting the entire drive is correct for the first type.
For the second type, you must mount a partition. Be warned that Windows (XP anyway) can only see the first partition.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum