Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

I've got a new SSD drive coming in soon, and I want to transfer my existing Ubuntu install onto the new drive. Any tips or ideas on how to go about this. I'd like to avoid a complete reinstall if possible. I'm going to be putting my / and /home partitions onto the new drive. Aren't there some config files that use rely on the drive UUID #s, that will break upon swapping out drives?

Adbot
ADBOT LOVES YOU

Marinmo
Jan 23, 2005

Prisoner #95H522 Augustus Hill
fstab and possibly menu.lst/grub.conf, don't really know if ubuntu uses uuid for the latter though

I really don't know if simply dd:ing a "normal" harddrive to an SSD is such a good thing though, at least all versions of windows will need to be reinstalled, but then again linux is quite much more flexible in those cases ...

Sepist
Dec 26, 2005

FUCK BITCHES, ROUTE PACKETS

Gravy Boat 2k
I would personally try and dd the drive from one to the other and edit fstab with the new uuid, you should be able to get the id from "vol_id /dev/$newdrive" (ID_FS_UUID=$)

I've had success dd'ing a windows drive this way as long as the hard drive drivers are deleted beforehand so I can't see why this wouldn't work.

Marinmo
Jan 23, 2005

Prisoner #95H522 Augustus Hill

Sepist posted:

I would personally try and dd the drive from one to the other and edit fstab with the new uuid, you should be able to get the id from "vol_id /dev/$newdrive" (ID_FS_UUID=$)

I've had success dd'ing a windows drive this way as long as the hard drive drivers are deleted beforehand so I can't see why this wouldn't work.
This is a dd from a mechanical drive to an SSD, not mechanical -> mechanical which has worked wonders forever and ever. Idk about linux, but windows refuses to play nice in this scenario.

dont skimp on the shrimp
Apr 23, 2008

:coffee:
Easiest way to do this would be by labels really.

And you should probably run either ext4 or btrfs. Btrfs has some optimizations for SSDs, but still has some teething problems. I'd recommend ext4.

But yeah, just make sure the fstab is correct and maybe update the initramfs and you should be good to go. Did something similar myself recently.

E: Oh, and use rsync -a to copy file permissions and make correct symlinks.

ToxicFrog
Apr 26, 2008


^^ Only if you're not using dd. Easiest is probably just to dd it over, then mount it and make sure fstab is correct.

dont skimp on the shrimp
Apr 23, 2008

:coffee:

ToxicFrog posted:

^^ Only if you're not using dd. Easiest is probably just to dd it over, then mount it and make sure fstab is correct.
Yeah, I meant over cp or mv. dd didn't even occur to me :doh:

And yeah, I know cp also has an -a option.

peepsalot
Apr 24, 2007

        PEEP THIS...
           BITCH!

Forgot to mention I'm going from ~100GB partition to 64GB(though i'm not using more than 64GB). doesn't dd copy blocks directly, meaning i would have to have at least as many blocks on the destination drive?

Also, there is no MS Windows installed on this box, so that is not a concern.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams
Gparted should be able to take care of most of this. Download a Gparted live CD, and have it copy and resize the old drive onto the new. After that you'll most likely need to manually edit the fstab like everybody else is saying, but you might not need to modify grub. You'll also still have to dd the mbr onto the new drive.

MadlabsRobot
May 1, 2005

I see what you did there....
Grimey Drawer
I've just installed debian on one of my computers and would like to be able to share files between the debian box and my windows 7 box.

I've installed samba while following this howto: http://www.howtoforge.com/debian-lenny-standalone-server-with-tdbsam-backend. I can now access my \user folder on the debian box by going to \\192.168.1.3 which is the ip-address of the debian box on the network.

But I can't access the \allusers -share that I made. I can see the folder but I get asked for a username and password and none of my usernames or passwords work. I assume that it is a problem with my samba configuration since I get the same problem when trying to access the folder by browsing to it on the network through the debian box.

Another problem is that I can't see the windows box when browsing the network from debian.

So what do I have to do to get debian to see the windows 7 shares and to be able to access the \allusers -share from windows?

MadlabsRobot fucked around with this message at 09:32 on Sep 1, 2010

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

MadlabsRobot posted:

I assume that it is a problem with my samba configuration since I get the same problem when trying to access the folder by browsing to it on the network through the debian box.
yeah probably

enotnert
Jun 10, 2005

Only women bleed

MadlabsRobot posted:

I've just installed debian on one of my computers and would like to be able to share files between the debian box and my windows 7 box.

I've installed samba while following this howto: http://www.howtoforge.com/debian-lenny-standalone-server-with-tdbsam-backend. I can now access my \user folder on the debian box by going to \\192.168.1.3 which is the ip-address of the debian box on the network.

But I can't access the \allusers -share that I made. I can see the folder but I get asked for a username and password and none of my usernames or passwords work. I assume that it is a problem with my samba configuration since I get the same problem when trying to access the folder by browsing to it on the network through the debian box.

Another problem is that I can't see the windows box when browsing the network from debian.

So what do I have to do to get debian to see the windows 7 shares and to be able to access the \allusers -share from windows?

Either make guest=ok or execute this on the command line

smbpasswd -a $username

Sointenly
Sep 7, 2008
Any trick to installing Ubutu 10.04 on a hardware RAID 0 array?

I've Googled the poo poo out of this questions and just cant seem to come up with a strait forward, consistent answer.

This cant be something that's all that uncommon.

I config the array in BIOS, but when I get into the OS install it still sees the drives as two separate disks. Of course at first I thought maybe my controller wasn't supported, but after doing a ton of reading that doesn't seem to be all that common of a complaint.

Any help would be much appreciated.

Bob Morales
Aug 18, 2006


Just wear the fucking mask, Bob

I don't care how many people I probably infected with COVID-19 while refusing to wear a mask, my comfort is far more important than the health and safety of everyone around me!

Sointenly posted:

Any trick to installing Ubutu 10.04 on a hardware RAID 0 array?

I've Googled the poo poo out of this questions and just cant seem to come up with a strait forward, consistent answer.

This cant be something that's all that uncommon.

I config the array in BIOS, but when I get into the OS install it still sees the drives as two separate disks. Of course at first I thought maybe my controller wasn't supported, but after doing a ton of reading that doesn't seem to be all that common of a complaint.

Any help would be much appreciated.

What card? Are you sure it's configured right?

Sointenly
Sep 7, 2008
I dont know the card type off the top of my head, its OEM on a DELL XPS desktop.

Pretty sure I configured it correctly, its just a 2 HD Raid 0 config.

inveratulo
May 14, 2002
wat

enotnert posted:

yalls sounds about as bad as ours, where you change the password on one machine, and one machine only, then at 30 on the hour the master server queries that machine for new data, then uses scp to push out new /etc/passwd, /etc/group, and /etc/shadow files to all the clients.

This method seems prone to the most comical of career-ending catastrophes.

Vulture Culture
Jul 14, 2003

I was never enjoying it. I only eat it for the nutrients.

Sointenly posted:

I config the array in BIOS, but when I get into the OS install it still sees the drives as two separate disks. Of course at first I thought maybe my controller wasn't supported, but after doing a ton of reading that doesn't seem to be all that common of a complaint.
This is certainly what's happening. Just do software RAID. You'll have to use the alternate install CD.

I would recommend not keeping your OS on the RAID-0. Do RAID-1 for the partitions holding your important data, and RAID-0 for your throwaway poo poo.

telcoM
Mar 21, 2009
Fallen Rib

Sointenly posted:

Any trick to installing Ubutu 10.04 on a hardware RAID 0 array?

I config the array in BIOS, but when I get into the OS install it still sees the drives as two separate disks. Of course at first I thought maybe my controller wasn't supported, but after doing a ton of reading that doesn't seem to be all that common of a complaint.

Your "hardware RAID" may actually be a "BIOS RAID" (sometimes also known as "fake RAID"). This became rather common at about the the time when SATA was introduced. Shortly after that, one of the Linux SATA developers wrote this FAQ document (note the trend):

https://ata.wiki.kernel.org/index.php/SATA_RAID_FAQ

As indicated at the bottom of the above-mentioned page, Linux *can* use some types of BIOS RAID, using a small bit of software called "dmraid". The way to write data on a RAID 0, RAID 1 or RAID 5 array is actually pretty standard; only the metadata that describes the array composition is manufacturer-specific. The dmraid software is just a small program that can read various manufacturer-specific RAID metadata formats and feed the necessary information to the tried-and-tested Linux software RAID code that does the actual work.

For Ubuntu, this might be the document you need:
https://help.ubuntu.com/community/FakeRaidHowto

But if you aren't planning to dual-boot, it might be easier to set up the system as a traditional Linux software RAID instead: the Linux OS installers usually have better support for straight-up software RAID than for dmraid.

Edit: Oh, the FakeRaidHowto only covers old versions of Ubuntu. Still, it has a good description of what is going on and why.

telcoM fucked around with this message at 19:34 on Sep 1, 2010

JHVH-1
Jun 28, 2002

Sointenly posted:

I dont know the card type off the top of my head, its OEM on a DELL XPS desktop.

Pretty sure I configured it correctly, its just a 2 HD Raid 0 config.

Some cards show up as individual drives if you don't have the correct driver loaded. You'll need to find what chip is on the motherboard, maybe check the Dell support page or whatever. But in reality if you have a card that shows up like that its usually not worth using anyway and as someone else said, you should use software RAID which performs just fine.

Waltzing Along
Jun 14, 2008

There's only one
Human race
Many faces
Everybody belongs here
I am currently taking a beginning Unix class and have come across a question in a homework assignment that I just can't seem to answer. This is a bit frustrating because everything else has been relatively easy and this seems like it should be easy, too. Unfortunately I can't find this specific situation in the book or online. Would someone help?

Here is the question:
Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the letter 'a' anywhere after the dot.

My answer so far: ll \.
This works just fine. Every single thing I have tried for that a is giving me an error message.

I've tried ll [a] which should just find any file with an a in it but that says [a] not found. I've tried mixing and matching all the options: *, [], ?, !(even though it is for excluding). Nothing is working. I'm stumped and know this has to be easy but just can't figure it out.

Thanks if someone cares to help.

dont skimp on the shrimp
Apr 23, 2008

:coffee:

Waltzing Along posted:

I am currently taking a beginning Unix class and have come across a question in a homework assignment that I just can't seem to answer. This is a bit frustrating because everything else has been relatively easy and this seems like it should be easy, too. Unfortunately I can't find this specific situation in the book or online. Would someone help?

Here is the question:
Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the letter 'a' anywhere after the dot.

My answer so far: ll \.
This works just fine. Every single thing I have tried for that a is giving me an error message.

I've tried ll [a] which should just find any file with an a in it but that says [a] not found. I've tried mixing and matching all the options: *, [], ?, !(even though it is for excluding). Nothing is working. I'm stumped and know this has to be easy but just can't figure it out.

Thanks if someone cares to help.
Backslash is for escaping characters. If you use \*, you'll only list files (or dirs) which name matches the asterisk itself, and not as a wildcard.

ls ./.* will, for example, list all dot-files in the current directory. This is a hint.

Also, ll is a common alias for ls -l.

covener
Jan 10, 2004

You know, for kids!

Waltzing Along posted:

I've tried ll [a] which should just find any file with an a in it but that says [a] not found. I've tried mixing and matching all the options: *, [], ?, !(even though it is for excluding). Nothing is working. I'm stumped and know this has to be easy but just can't figure it out.

You're using a regular expression, but the way this is supposed to work is the _shell_ does globbing (or fnmatch'ing) style expansion which is a bit different.

The operative differences for you will be:

* globs are not usually applied as substrings -- leading and trailing addl characters need to be acounted for (e.g. with wildcards if you don't care)
* '*' and '?' are wildcards by themselves, not repetition operators on some other wildcard char ('.') like in a regex.


When a glob fails to match anything, the shell passes it directly to the application. That's why an argument of [a] triggers an ls error message but a proper glob is expanded and handed to ls. (most occasional unix users have no clue that the shell is expanding this)

MadlabsRobot
May 1, 2005

I see what you did there....
Grimey Drawer

enotnert posted:

Either make guest=ok or execute this on the command line

smbpasswd -a $username

Hmm, neither seems to work. This is what the [allusers] part of my .conf-file looks like;

code:
[allusers]
  comment = All Users
  path = /home/shares/allusers
  valid users = @users
  force group = users
  create mask = 0660
  directory mask = 0771
  writable = yes
  available = yes
  browsable = yes
  public = yes
  guest ok = yes
Does it look ok?

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams

MadlabsRobot posted:

Hmm, neither seems to work. This is what the [allusers] part of my .conf-file looks like;

code:
[allusers]
  comment = All Users
  path = /home/shares/allusers
  valid users = @users
  force group = users
  create mask = 0660
  directory mask = 0771
  writable = yes
  available = yes
  browsable = yes
  public = yes
  guest ok = yes
Does it look ok?

I believe you'll also need force user = your username here

MadlabsRobot
May 1, 2005

I see what you did there....
Grimey Drawer

FISHMANPET posted:

I believe you'll also need force user = your username here

Didn't work either.

But I found this:

some how-to posted:

Any new directory created in the share will be given the directory permissions of 777, and any new file will have file permissions of 666. These mask settings allow any user to save files to the shared directory, and any other user can read, write or delete the files.

and posted:

Still Getting "Access Denied" Errors
You may have successfully created all of your shares for the Samba server and they may all be publicly accessible to the client workstation, however you may still be getting "Access Denied" errors on your Windows workstation. This normally occurs when the underlying file and directory permissions on the Linux filesystem are not appropriate to what the user has been granted.

The [Shared] section which we declared earlier in our set up has been configured to allow full permissions for everyone to access the shared resource. For Samba to fully support the requirements here, the "/samba/shared" directory must be assigned the directory permissions of 777, the default directory permissions of 755 would not allow all world users to create new files, regardless of the two "mask" declarations.

So I changed my .conf to;

code:
[allusers]
  comment = All Users
  path = /home/shares/allusers
  read only = no
  create mask = 0666
  directory mask = 0777
  guest ok = yes
And now I can atleast get in to the \allusers -folder. But I still can't write to it...

Waltzing Along
Jun 14, 2008

There's only one
Human race
Many faces
Everybody belongs here

Zom Aur posted:

Backslash is for escaping characters. If you use \*, you'll only list files (or dirs) which name matches the asterisk itself, and not as a wildcard.

ls ./.* will, for example, list all dot-files in the current directory. This is a hint.

Also, ll is a common alias for ls -l.

Thanks. The ./.* comment seems to work the same as \. Is there a difference? Also, even with your hint I feel like I am banging my head on the wall. Fortunately I still have 24 hours to finish and even if I scrap this one question it is only a point. I would prefer to actually understand what I am doing. This doesn't seem like an oft used function, anyway.

Actually, ./.* is giving me two directories rather than just the one I am in. It is giving that one and the parent.

covener posted:

Greek
I do appreciate your response but couldn't follow it at all. :(

Waltzing Along fucked around with this message at 01:31 on Sep 7, 2010

covener
Jan 10, 2004

You know, for kids!

Waltzing Along posted:

I do appreciate your response but couldn't follow it at all. :(

Sorry, I thought you were making a different common mistake.

I think you're overthinking the exercise. With globs (wildcards/metacharacters on command lines), you have to match the entire thing you want to be passed to the program, not just a substring of it.

ls -l datafiles/ would feed give you all the files
ls -l datafiles/* would also give you all the files (in a slightly different way)
ls -l datafiles/*. would give you all the files _ending_ in a period
ls -l datatiles/*.* would give you all the files _containing_ a period
...
ls -l datafiles/[a-z]* gives you anything starting with a lowercase character (not needed for your exercise, but you seemed to be going down this path somehow during trial and error)

quote:


Actually, ./.* is giving me two directories rather than just the one I am in. It is giving that one and the parent.

It's a bad/tricky example command line. You want the shell to hand a list of _files_ to the ls command, but this actually resolves (only) to two directories "." and ".." which mean the parent and current directory. ls is perfectly happy to list the contents of directories when you pass them in.

Lonely Wolf
Jan 20, 2003

Will hawk false idols for heaps and heaps of dough.
Try the following
code:
echo .
echo \.
echo *
echo \*

ls .
ls \.
ls \*
ls *
It might help to see the differences.

Waltzing Along
Jun 14, 2008

There's only one
Human race
Many faces
Everybody belongs here
ll *\.*a*

is the answer. I don't really understand what it means, though. Well, I sort of do, but there are so many * in there that I am a bit confused. In any case I finished the stupid assignment.

Thank you for your assistance.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams

Waltzing Along posted:

ll *\.*a*

is the answer. I don't really understand what it means, though. Well, I sort of do, but there are so many * in there that I am a bit confused. In any case I finished the stupid assignment.

Thank you for your assistance.

It's a regular expression. It matches a string that has 0 or more occurrences of any charter, then a period (it is written as \. because the period is escaped, a period means something special in regex so escaping it, or putting that slash in front, tells the shell to just treat it as a character, and not apply its special meaning), then 0 or more occurrences of any character, than an a, then zero or more occurrences of any character.

ShoulderDaemon
Oct 9, 2003
support goon fund
Taco Defender

FISHMANPET posted:

It's a regular expression. It matches a string that has 0 or more occurrences of any charter, then a period (it is written as \. because the period is escaped, a period means something special in regex so escaping it, or putting that slash in front, tells the shell to just treat it as a character, and not apply its special meaning), then 0 or more occurrences of any character, than an a, then zero or more occurrences of any character.

The period has no special significance to the shell. The backslash is useless, and can be removed without changing the meaning of the glob expression.

Waltzing Along: You should do what Lonely Wolf suggested, and experiment with globs using echo. In this case, the only special character in your expression is *, which can be read as "some stuff". So your glob is "some stuff, a period, some stuff, an a, some stuff", which is exactly what your assignment was asking for.

Peanutmonger
Dec 6, 2002

FISHMANPET posted:

It's a regular expression.

Actually, as indirectly mentioned by ShoulderDaemon, shell expansion doesn't use regexes, they use globbing, and there's a big difference between the two. See: `man 7 glob` vs `man 7 regex`. There's some very important distinctions so it's a good idea to distinguish between the two when discussing pattern matching expressions.

Underflow
Apr 4, 2008

EGOMET MIHI IGNOSCO

Waltzing Along posted:

Here is the question:
Use metacharacters and the ll command to list all filenames under the datafiles directory that contain a dot "." with the letter 'a' anywhere after the dot.

My answer so far: ll \.
This works just fine. Every single thing I have tried for that a is giving me an error message.

I've tried ll [a] which should just find any file with an a in it but that says [a] not found. I've tried mixing and matching all the options: *, [], ?, !(even though it is for excluding). Nothing is working. I'm stumped and know this has to be easy but just can't figure it out.

Thanks if someone cares to help.

I don't have ll and may be totally missing the point of your question, but " ls -al ./.*a* " will list every dot file containing an a anywhere in its name. From what I read re. ll (a contraction of ls -l ?), " ll -a ./.*a* " should do the same; unless the -a switch is alreay implied in the ll command. Also, you don't need to actually cd to the file directory to be scanned; just replace the " ./ " (current directory prefix) with the full path of a directory you want to check; e.g. " ls -al /home/bro/rad/p*n "

e: beaten and humbled

Underflow fucked around with this message at 10:27 on Sep 7, 2010

MadlabsRobot
May 1, 2005

I see what you did there....
Grimey Drawer

MadlabsRobot posted:

And now I can atleast get in to the \allusers -folder. But I still can't write to it...

Ok, seems like I managed to solve it by doing

# chmod -R a+rw /home/shares/allusers

which, if I understand the man-page for chmod correctly, gives all users the right to read and write to the folder. Is this a terrible unsafe thing to do? I might like to make that folder accessible from the outside through ftp later on.

FISHMANPET
Mar 3, 2007

Sweet 'N Sour
Can't
Melt
Steel Beams

MadlabsRobot posted:

Ok, seems like I managed to solve it by doing

# chmod -R a+rw /home/shares/allusers

which, if I understand the man-page for chmod correctly, gives all users the right to read and write to the folder. Is this a terrible unsafe thing to do? I might like to make that folder accessible from the outside through ftp later on.

You should make the folder group readable and writable by the group that guest users get mapped to.

rugbert
Mar 26, 2003
yea, fuck you
Whats the best way to access my file remotely from a windows machine? I used ubuntu server 10.4 as a web server and want to work with files on the server from anywhere.

enotnert
Jun 10, 2005

Only women bleed

rugbert posted:

Whats the best way to access my file remotely from a windows machine? I used ubuntu server 10.4 as a web server and want to work with files on the server from anywhere.

ssh

rugbert
Mar 26, 2003
yea, fuck you

enotnert posted:

ssh

Yea, I was actually hoping to use notepad++ to edit files, and maybe some photoshop. Can I remotely map a folder or something?

Puck42
Oct 7, 2005

You can try using http://dokan-dev.net/en/download/#sshfs

I've never used it, but I have used FUSE's SSHFS function and works pretty well.

Adbot
ADBOT LOVES YOU

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

rugbert posted:

Yea, I was actually hoping to use notepad++ to edit files, and maybe some photoshop. Can I remotely map a folder or something?

I've used a program called SftpDrive that worked pretty well for doing that. Looks like they have since changed the name to ExpanDrive.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply